#include <iostream>
using namespace std;

int main()
{

	const int *ptrcInt;   //const int;

	int var1=10;
	int var2=20;

	ptrcInt = &var1;

	cout << ptrcInt << endl;    // display both strings
	cout << *ptrcInt << endl;    // display both strings

	//*ptrcInt = var2;
	//ptrcInt = &var2;

	cout << ptrcInt << endl;    // display both strings
	cout << *ptrcInt << endl;    // display both strings



	int* const cptrInt = &var1;	  //const ptr; 

	cout << cptrInt << endl;    // display both strings
	cout << *cptrInt << endl;    // display both strings


	//cptrInt = &var2;
	//*cptrInt = var2;	  //const ptr; 

	cout << cptrInt << endl;    // display both strings
	cout << *cptrInt << endl;    // display both strings


	return 0;
}




/*



class alpha
   {
   private:
      int data;
   public:
      alpha()                      //no-arg constructor
         { }
      alpha(int d)                 //one-arg constructor
         { data = d; }
      void display()               //display data
         { cout << data; }
	
      alpha& operator = (alpha& a) //overloaded = operator
         {
         data = a.data;            //not done automatically
         cout << "\nAssignment operator invoked";
         return *this;             //return copy of this alpha
         }

	  alpha* getaddress()
	  {
		  cout << this;
		  return this;
	  }
   };
////////////////////////////////////////////////////////////////
int main()
   {
   alpha a1(37);
   alpha a2, a3;

   a3 = a2 = a1;                   //invoke overloaded =, twice

   cout << "\na2="; a2.display();  //display a2
   cout << "\na3="; a3.display();  //display a3
   cout << endl;

   cout << "\na1="; a1.getaddress();  //display a1
   cout << "\na2="; a2.getaddress();  //display a2
   cout << "\na3="; a3.getaddress();  //display a3
   cout << endl;


    alpha *a4, *a5;

    //a4 = a1.getaddress();                   
    //a5 = a4->getaddress();                   

	a4 = &a1;                   
    a5 = a4;   

	cout << "\na4="; a4->display();  //display a4
	cout << "\na5="; a5->display();  //display a5
    cout << endl;


   cout << "\na1="; a1.getaddress();  //display a1
   cout << "\na4="; a4->getaddress();  //display a4
   cout << "\na5="; a5->getaddress();  //display a5


   alpha *a6= new alpha(38);

   a4 = a6;                   
   a5 = a4;  

   cout << "\na4="; a4->display();  //display a4
	cout << "\na5="; a5->display();  //display a5
    cout << endl;


   cout << "\na6="; a6->getaddress();  //display a1
   cout << "\na4="; a4->getaddress();  //display a4
   cout << "\na5="; a5->getaddress();  //display a5

   delete a6;

    cout << "\na6="; a6->getaddress();

   return 0;
   }

   */